<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Superpixel Benchmark: SuperpixelTools Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Superpixel Benchmark
   </div>
   <div id="projectbrief">Superpixel benchmark, tools and algorithms.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classSuperpixelTools-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">SuperpixelTools Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Superpixel utilities.  
 <a href="classSuperpixelTools.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="superpixel__tools_8h_source.html">superpixel_tools.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a0816df16890a5ae85051c5aba777bf62"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSuperpixelTools.html#a0816df16890a5ae85051c5aba777bf62">computeRegionSizeFromSuperpixels</a> (const cv::Mat &amp;image, int superpixels)</td></tr>
<tr class="memdesc:a0816df16890a5ae85051c5aba777bf62"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute region size from desired number of superpixels.  <a href="#a0816df16890a5ae85051c5aba777bf62">More...</a><br /></td></tr>
<tr class="separator:a0816df16890a5ae85051c5aba777bf62"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8790f88cee8b76b27b5ecfb6d26cd70f"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSuperpixelTools.html#a8790f88cee8b76b27b5ecfb6d26cd70f">computeHeightWidthFromSuperpixels</a> (const cv::Mat &amp;image, int superpixels, int &amp;height, int &amp;width)</td></tr>
<tr class="memdesc:a8790f88cee8b76b27b5ecfb6d26cd70f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute width and height for the given number of superpixels.  <a href="#a8790f88cee8b76b27b5ecfb6d26cd70f">More...</a><br /></td></tr>
<tr class="separator:a8790f88cee8b76b27b5ecfb6d26cd70f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a408d9d44b357e5dd01928f3250894013"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSuperpixelTools.html#a408d9d44b357e5dd01928f3250894013">computeHeightWidthLevelsFromSuperpixels</a> (const cv::Mat &amp;image, int superpixels, int &amp;height, int &amp;width, int &amp;levels)</td></tr>
<tr class="memdesc:a408d9d44b357e5dd01928f3250894013"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute width, height and levels for the given number of superpixels.  <a href="#a408d9d44b357e5dd01928f3250894013">More...</a><br /></td></tr>
<tr class="separator:a408d9d44b357e5dd01928f3250894013"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afaf7643c2a18389b6e237b56919abfc9"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSuperpixelTools.html#afaf7643c2a18389b6e237b56919abfc9">computeRegionSizeLevels</a> (const cv::Mat &amp;image, int superpixels, int &amp;region_size, int &amp;levels)</td></tr>
<tr class="memdesc:afaf7643c2a18389b6e237b56919abfc9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute region size and levels for the given number of superpixels.  <a href="#afaf7643c2a18389b6e237b56919abfc9">More...</a><br /></td></tr>
<tr class="separator:afaf7643c2a18389b6e237b56919abfc9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2d29ccc05873472b9fa0936252d0f7c1"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSuperpixelTools.html#a2d29ccc05873472b9fa0936252d0f7c1">relabelSuperpixels</a> (cv::Mat &amp;labels)</td></tr>
<tr class="memdesc:a2d29ccc05873472b9fa0936252d0f7c1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Relabel superpixel segmentation.  <a href="#a2d29ccc05873472b9fa0936252d0f7c1">More...</a><br /></td></tr>
<tr class="separator:a2d29ccc05873472b9fa0936252d0f7c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a561140deeedd92c1ca01d32aa8c7e4c4"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSuperpixelTools.html#a561140deeedd92c1ca01d32aa8c7e4c4">computeLabelsFromBoundaries</a> (const cv::Mat &amp;image, const cv::Mat &amp;boundaries, cv::Mat &amp;labels, int BOUNDARY_VALUE=-1, int INNER_VALUE=-2)</td></tr>
<tr class="memdesc:a561140deeedd92c1ca01d32aa8c7e4c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute label map from boundaries by assigning boundary pixels to the nearest superpixel and flooding the connected components.  <a href="#a561140deeedd92c1ca01d32aa8c7e4c4">More...</a><br /></td></tr>
<tr class="separator:a561140deeedd92c1ca01d32aa8c7e4c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af96e8a673fefbf8abdfcc7f34a7139a7"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSuperpixelTools.html#af96e8a673fefbf8abdfcc7f34a7139a7">assignBoundariesToSuperpixels</a> (const cv::Mat &amp;image, const cv::Mat &amp;boundaries, cv::Mat &amp;labels, int BOUNDARY_VALUE=-1)</td></tr>
<tr class="memdesc:af96e8a673fefbf8abdfcc7f34a7139a7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assigns boundary pixels (indicated by -1) to the nearest superpixel (indicated by labels &gt;= 0).  <a href="#af96e8a673fefbf8abdfcc7f34a7139a7">More...</a><br /></td></tr>
<tr class="separator:af96e8a673fefbf8abdfcc7f34a7139a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3fbd5f0a7107ef6edf7b984becbdd247"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSuperpixelTools.html#a3fbd5f0a7107ef6edf7b984becbdd247">countSuperpixels</a> (const cv::Mat &amp;labels)</td></tr>
<tr class="memdesc:a3fbd5f0a7107ef6edf7b984becbdd247"><td class="mdescLeft">&#160;</td><td class="mdescRight">Count number of superpixels.  <a href="#a3fbd5f0a7107ef6edf7b984becbdd247">More...</a><br /></td></tr>
<tr class="separator:a3fbd5f0a7107ef6edf7b984becbdd247"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc11994f0a1575477c7f4cb04ae90284"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSuperpixelTools.html#adc11994f0a1575477c7f4cb04ae90284">relabelConnectedSuperpixels</a> (cv::Mat &amp;labels)</td></tr>
<tr class="memdesc:adc11994f0a1575477c7f4cb04ae90284"><td class="mdescLeft">&#160;</td><td class="mdescRight">Relabel superpixels based on connected components.  <a href="#adc11994f0a1575477c7f4cb04ae90284">More...</a><br /></td></tr>
<tr class="separator:adc11994f0a1575477c7f4cb04ae90284"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a17d54c4d603b7c33e49462110e98d07f"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSuperpixelTools.html#a17d54c4d603b7c33e49462110e98d07f">enforceMinimumSuperpixelSize</a> (const cv::Mat &amp;image, cv::Mat &amp;labels, int size)</td></tr>
<tr class="memdesc:a17d54c4d603b7c33e49462110e98d07f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enforce the minimum segment size by merging small superpixels with similar neighboring superpixels.  <a href="#a17d54c4d603b7c33e49462110e98d07f">More...</a><br /></td></tr>
<tr class="separator:a17d54c4d603b7c33e49462110e98d07f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5aaf0277c4c0b811c97994ca777c8fb1"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSuperpixelTools.html#a5aaf0277c4c0b811c97994ca777c8fb1">enforceMinimumSuperpixelSizeUpTo</a> (const cv::Mat &amp;image, cv::Mat &amp;labels, int number)</td></tr>
<tr class="memdesc:a5aaf0277c4c0b811c97994ca777c8fb1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enforce the minimum segment size by merging small superpixels with similar neighboring superpixels such that the given number of superpixels is merged.  <a href="#a5aaf0277c4c0b811c97994ca777c8fb1">More...</a><br /></td></tr>
<tr class="separator:a5aaf0277c4c0b811c97994ca777c8fb1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Superpixel utilities. </p>
<p>Copyright (c) 2016, David Stutz Contact: <a href="#" onclick="location.href='mai'+'lto:'+'dav'+'id'+'.st'+'ut'+'z@r'+'wt'+'h-a'+'ac'+'hen'+'.d'+'e'; return false;">david<span style="display: none;">.nosp@m.</span>.stu<span style="display: none;">.nosp@m.</span>tz@rw<span style="display: none;">.nosp@m.</span>th-a<span style="display: none;">.nosp@m.</span>achen<span style="display: none;">.nosp@m.</span>.de</a>, davidstutz.de All rights reserved.</p>
<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p>
<ol type="1">
<li>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</li>
<li>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</li>
<li>Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.</li>
</ol>
<p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p><dl class="section author"><dt>Author</dt><dd>David Stutz </dd></dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="af96e8a673fefbf8abdfcc7f34a7139a7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SuperpixelTools::assignBoundariesToSuperpixels </td>
          <td>(</td>
          <td class="paramtype">const cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>boundaries</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>labels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>BOUNDARY_VALUE</em> = <code>-1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Assigns boundary pixels (indicated by -1) to the nearest superpixel (indicated by labels &gt;= 0). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">image</td><td>image to compute superpixels for </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">boudnaries</td><td>given boundaries to convert to superpixel labels </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">BOUDARY_VALUE</td><td>value a boundary pixel takes </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a8790f88cee8b76b27b5ecfb6d26cd70f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SuperpixelTools::computeHeightWidthFromSuperpixels </td>
          <td>(</td>
          <td class="paramtype">const cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>superpixels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&#160;</td>
          <td class="paramname"><em>width</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Compute width and height for the given number of superpixels. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">image</td><td>image for the number of rows and cols </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">superpixels</td><td>number of desired superpixels </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">height</td><td>region height to achieve desired number of superpixels </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">width</td><td>region width to achieve desired number of superpixels </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a408d9d44b357e5dd01928f3250894013"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SuperpixelTools::computeHeightWidthLevelsFromSuperpixels </td>
          <td>(</td>
          <td class="paramtype">const cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>superpixels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&#160;</td>
          <td class="paramname"><em>levels</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Compute width, height and levels for the given number of superpixels. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">image</td><td>image for the number of rows and cols </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">superpixels</td><td>desired number of superpixels </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">height</td><td>region height on lowest level </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">width</td><td>region width on lowest level </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">levels</td><td>number of levels to achieve the desired number of superpixels </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a561140deeedd92c1ca01d32aa8c7e4c4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SuperpixelTools::computeLabelsFromBoundaries </td>
          <td>(</td>
          <td class="paramtype">const cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>boundaries</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>labels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>BOUNDARY_VALUE</em> = <code>-1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>INNER_VALUE</em> = <code>-2</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Compute label map from boundaries by assigning boundary pixels to the nearest superpixel and flooding the connected components. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">image</td><td>image to compute superpixel labels for </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">boundaries</td><td>given boundaries for image </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">labels</td><td>computed superpixel labels </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">BOUDNARY_VALUE</td><td>the value a boundary pixel takes </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">INNER_VALUE</td><td>the value an inner pixel takes </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a0816df16890a5ae85051c5aba777bf62"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int SuperpixelTools::computeRegionSizeFromSuperpixels </td>
          <td>(</td>
          <td class="paramtype">const cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>superpixels</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Compute region size from desired number of superpixels. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">image</td><td>image for number of rows and cols </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">superpixels</td><td>number of desired superpixels </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>region size required for the desired number of superpixels on the given image size</dd></dl>
<p>Copyright (c) 2016, David Stutz Contact: <a href="#" onclick="location.href='mai'+'lto:'+'dav'+'id'+'.st'+'ut'+'z@r'+'wt'+'h-a'+'ac'+'hen'+'.d'+'e'; return false;">david<span style="display: none;">.nosp@m.</span>.stu<span style="display: none;">.nosp@m.</span>tz@rw<span style="display: none;">.nosp@m.</span>th-a<span style="display: none;">.nosp@m.</span>achen<span style="display: none;">.nosp@m.</span>.de</a>, davidstutz.de All rights reserved.</p>
<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p>
<ol type="1">
<li>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</li>
<li>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</li>
<li>Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.</li>
</ol>
<p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. </p>

</div>
</div>
<a class="anchor" id="afaf7643c2a18389b6e237b56919abfc9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SuperpixelTools::computeRegionSizeLevels </td>
          <td>(</td>
          <td class="paramtype">const cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>superpixels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&#160;</td>
          <td class="paramname"><em>region_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&#160;</td>
          <td class="paramname"><em>levels</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Compute region size and levels for the given number of superpixels. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">image</td><td>image for the number of rows and cols </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">superpixels</td><td>desired number of superpixels </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">region_size</td><td>region size on lowest level </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">levels</td><td>number of levels to achieve desired number of superpixels </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a3fbd5f0a7107ef6edf7b984becbdd247"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int SuperpixelTools::countSuperpixels </td>
          <td>(</td>
          <td class="paramtype">const cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>labels</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Count number of superpixels. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">labels</td><td>superpixel labels </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of superpixels </dd></dl>

</div>
</div>
<a class="anchor" id="a17d54c4d603b7c33e49462110e98d07f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int SuperpixelTools::enforceMinimumSuperpixelSize </td>
          <td>(</td>
          <td class="paramtype">const cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>labels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Enforce the minimum segment size by merging small superpixels with similar neighboring superpixels. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">image</td><td>image to enforce minimum superpixel size for </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">labels</td><td>superpixel labels </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>minimum superpixel size </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>new number of superpixels </dd></dl>

</div>
</div>
<a class="anchor" id="a5aaf0277c4c0b811c97994ca777c8fb1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int SuperpixelTools::enforceMinimumSuperpixelSizeUpTo </td>
          <td>(</td>
          <td class="paramtype">const cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>labels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>number</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Enforce the minimum segment size by merging small superpixels with similar neighboring superpixels such that the given number of superpixels is merged. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">image</td><td>image to enforce minimum superpixels on </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">labels</td><td>superpixel labels </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">number</td><td>number of desired superpixels after enforcing minimum size </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="adc11994f0a1575477c7f4cb04ae90284"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int SuperpixelTools::relabelConnectedSuperpixels </td>
          <td>(</td>
          <td class="paramtype">cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>labels</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Relabel superpixels based on connected components. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">labels</td><td>superpixel labels to relabel as connected </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a2d29ccc05873472b9fa0936252d0f7c1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SuperpixelTools::relabelSuperpixels </td>
          <td>(</td>
          <td class="paramtype">cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>labels</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Relabel superpixel segmentation. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">labels</td><td>superpixel labels to relabel </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>lib_eval/<a class="el" href="superpixel__tools_8h_source.html">superpixel_tools.h</a></li>
<li>lib_eval/<a class="el" href="superpixel__tools_8cpp.html">superpixel_tools.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Apr 16 2017 16:39:17 for Superpixel Benchmark by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
